@echo off
echo 📱 创建杂志图片管理器桌面快捷方式...

set "APP_PATH=%~dp0run_app.bat"
set "ICON_PATH=%~dp0static\favicon.ico"
set "SHORTCUT_NAME=杂志图片管理器.lnk"

REM 检查桌面路径
if exist "%USERPROFILE%\Desktop" (
    set "DESKTOP_PATH=%USERPROFILE%\Desktop"
) else if exist "%PUBLIC%\Desktop" (
    set "DESKTOP_PATH=%PUBLIC%\Desktop"
) else (
    echo ❌ 无法找到桌面路径
    pause
    exit /b 1
)

REM 创建快捷方式
echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs
echo sLinkFile = "%DESKTOP_PATH%\%SHORTCUT_NAME%" >> CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
echo oLink.TargetPath = "%APP_PATH%" >> CreateShortcut.vbs
echo oLink.WorkingDirectory = "%~dp0" >> CreateShortcut.vbs
echo oLink.Description = "杂志图片管理桌面应用" >> CreateShortcut.vbs
echo oLink.IconLocation = "%ICON_PATH%" >> CreateShortcut.vbs
echo oLink.Save >> CreateShortcut.vbs

cscript CreateShortcut.vbs >nul 2>&1
del CreateShortcut.vbs

if exist "%DESKTOP_PATH%\%SHORTCUT_NAME%" (
    echo ✅ 桌面快捷方式创建成功！
    echo 📍 位置：%DESKTOP_PATH%\%SHORTCUT_NAME%
) else (
    echo ❌ 快捷方式创建失败
)

pause